<%@page import="com.dd.shop4j.goods.model.GoodsCateg"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<html>
<head>
<title>商品品牌</title>
<%@ include file="../../../common/admin_taglib.jsp" %>
</head>
<body>

<h1 class="page-title">Shop4j 管理中心</h1>
<ul class="breadcrumb">
	 <li><a href="${ctx}/admin/main">管理中心</a><span class="divider">/</span></li>
     <li><a href="${ctx}/admin/brand">商品品牌</a><span class="divider">/</span></li>
     <li class="active">商品品牌信息</li>
</ul>
<form:form id="saveForm" enctype="multipart/form-data" method="post" commandName="brand">
<div class="row-fluid">
	<div class="btn-toolbar">
		<dd:token></dd:token>
    	<button type="button" class="btn btn-primary" onclick="$('#saveForm').submit();"><i class="icon-ok"></i> 保存</button>
    	<input class="btn" value="重置" type="reset"/>
  		<div class="btn-group"></div>
	</div>

	<div class="well">
		<ul class="thumbnails">
			<li class="span3">
				<a class="thumbnail" href="${brand.linkUrl}" target="_blank">
					<dd:image url="${brand.logoUrl}" title="${brand.name}"></dd:image>
				</a>
			</li>
			<li class="span3">
				<label>品牌名称</label>
				<form:input path="name" class="input-xxlarge validate" validate="empty"/>
				
				<label>官网地址</label>
				<form:input path="linkUrl" class="input-xxlarge"/>
				
				<label>商品LOGO图标</label>
				<label class="radio" onclick="$('#logo_div').html('<input name=\'logoUrlFile\' type=\'file\' />');">
        			<input name="logo_type" type="radio" ${fn:startsWith(brand.logoUrl, 'http') ? "" : "checked='checked'"}/>
        			本地上传
        		</label>
        		<label class="radio" onclick="$('#logo_div').html('<input name=\'logoUrl\' type=\'text\' class=\'input-xxlarge\' value=\'${brand.logoUrl}\' />');">
        			<input name="logo_type" type="radio" ${fn:startsWith(brand.logoUrl, 'http') ? "checked='checked'" : ""}/>
        			网络图片
        		</label>
        		<div id="logo_div">
        			<c:choose>
						<c:when test="${fn:startsWith(brand.logoUrl, 'http')}">
							<input name="logoUrl" type="text" value="${brand.logoUrl}" class="input-xxlarge" />
						</c:when>
						<c:otherwise>
							<input name="logoUrlFile" type="file" />
						</c:otherwise>
					</c:choose>
        		</div>
        		
        		<form:hidden  path="id"/>
			</li>
		</ul>		
	   	
	</div>
</div>
</form:form>

</body>
</html>
